const state = {
  userinfo: {
    name: 'banqiusoft',
    age: 18,
    gender: 1,
    address: '河南省郑州市中原区'
  },
  score: 88
}
const mutations = {
  setUser (state, user) {
    state.userinfo = user.userinfo
    state.score = user.score
  }
}
const actions = {
  setUserAction (state, user) {
    console.log('执行到actions', user)
    setTimeout(() => {
      state.commit('setUser', user)
    }, 3000)
  }
}
const getters = {
  UpperCaseName () {
    return state.userinfo.name.toUpperCase()
  }
}
export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
